home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / tmg108.zip / SCRIPTS.DOC < prev   
Text File  |  1997-05-09  |  74KB  |  1,656 lines

  1.   SCRIPTS.DOC                                                        Page  1
  2.   ╒═════════════════════════════════════════════════════════════════════════╕
  3.   │             The Magic Gate version 1.08                                 │
  4.   │             Documentation  May/June '97                                 │
  5.   │             (C) Copyright 1995 - 1997 All Rights Reserved               │
  6.   │               Joseph O'Connor                                           │
  7.   ╘═════════════════════════════════════════════════════════════════════════╛
  8.  
  9.         This game may be distributed in its original, unmodified form as
  10.   long as no money is made off of it.  Please do not include the contents
  11.   of this archive in any CD, collection, or whatever without express written
  12.   permission of ME!
  13.  
  14.   This file was written for all you gamers out there who want to have a 
  15.   custom game going on on your system.  Contained within are the secrets of
  16.   the universe.... No wait, that was the other document, this one has all the
  17.   information you will need to write areas for Magic Gate.  What you will find
  18.   will shock, will stun, will even AMAZE you, so true believers, sit back and
  19.   enjoy the ride.
  20.  
  21.   ─═════════════════════════════════════════════════════════════════════════─
  22.   Introduction:
  23.  
  24.   
  25.   As you may, or may not know, The Magic Gate supports EXternal MODuleS which
  26.   can be written by anyone in any language whatsoever and you get to mess with
  27.   drop files and writing your own routines for things I've already done.
  28.   Don't get me wrong, that is the best route to go if you want to do something
  29.   totally slick and new.  But if you don't need all the bells, whistles and
  30.   power of say, Turbo Pascal, C++ etc, you can still add something 100% unique
  31.   to your game.  The answer lies within the power of ASCII scripts which can
  32.   be written with any word processor or text editor.  This is new as of
  33.   version 1.02, but I have written several test scripts to test it as thorough
  34.   as possible.  First I will go through the pre-defined variables and what
  35.   they reference, then a list of predefined commands, using examples if I
  36.   feel like it ;) etc... hopefully by the end you will understand enough of
  37.   the language to write a script.  (I need to have more programmer friends,
  38.   all of the friends I had look at this had their head explode... <G>)
  39.  
  40.   SCRIPTS.DOC                                                        Page  2
  41.   ─═════════════════════════════════════════════════════════════════════════─
  42.   All about Variables:
  43.  
  44.   Variables are EVERYWHERE.  (Don't make me give examples..)  TMG Scripting
  45.   Language (TMGSL?? whatever) has a bunch of variables, and a bunch of funny
  46.   looking strings that represent variables.  There are 20 variables each,
  47.   of 80 bytes (characters) in length which can be used to store both numerical
  48.   and textual data (Don't ask me how it works, it just does).  As well as
  49.   29 variables which are either 1 (On) or 0 (Off) or 2 (Maybe) (nevermind)...
  50.   These variables, and their contents can be accessed via escape codes in
  51.   the ASCII script file.  It's example time kiddies!  Okay, say you wanted
  52.   to print how much gold the character currently had on him/her.  You would
  53.   write a line in the script file that looked just like this:
  54.  
  55.     Writeln "Gold on Hand : ^CS18"
  56.  
  57.   Say the character had 386 gold on had, the line would look like this:
  58.  
  59.     Gold on Hand : 386
  60.  
  61.   Amazing, isn't it?  Don't worry about each command just yet, the variables
  62.   are what is going to make the program go...  You can check the contents of
  63.   variables conditionally as well.  You could check to see if the player had
  64.   any creature fights and then perform a certain action easily by doing
  65.   something like this:
  66.  
  67.     If ^CS26 > 0
  68.       Writeln "You Have ^CS26 creature fights left today."
  69.     Endif
  70.  
  71.   If the player doesn't have any forest fights left, then the Writeln statement
  72.   will not be executed, and neither would enything before the Endif.
  73.   
  74.   Hopefully the fog is starting to lift from your brain and things have
  75.   become much clearer.  No?  Well, this is only Page 2
  76.   
  77.   SCRIPTS.DOC                                                        Page  3
  78.   ─═════════════════════════════════════════════════════════════════════════─
  79.   Variables of Gender :
  80.   
  81.  
  82.   ^CA   Character Name
  83.   ^CB   male/female, based on sex of character
  84.   ^CC   son/daughter, based on sex of character
  85.   ^CD   his/her, based on sex of character
  86.   ^CE   he/she, based on sex of character
  87.   ^CF   him/her, based on sex of character
  88.   ^CG   sir/ma'am, based on sex of character
  89.   
  90.   ^DA   Name of Character's master
  91.   ^DB   male/female, based on sex of characters master
  92.   ^DC   son/daughter, based on sex of characters master
  93.   ^DD   his/her, based on sex of characters master
  94.   ^DE   he/she, based on sex of characters master
  95.   ^DF   him/her, based on sex of characters master
  96.   ^DG   sir/ma'am, based on sex of characters master
  97.   
  98.   Using just these variables, you can make menus look gramatically correct
  99.   for EVERY character.  Say you wanted to have a few lines of text, whether
  100.   its in a menu, or in Write/Writeln statements, that gives the person the
  101.   idea that they are going up to their master and kneeling at his/her feet.
  102.   Do something Just like this:
  103.  
  104.     Writeln "  You go up to ^DA and kneel at ^DD feet."
  105.     Writeln "  ^DA acknowledges you and says :"
  106.     Writeln "  'What can I do for you my ^CC?'"
  107.  
  108.   Lets use Martissa as your master, mastissa is female.  You are Bob, you are
  109.   male.  These 3 lines would look like this:
  110.  
  111.      You go up to Martissa and kneel at her feet.
  112.      Martissa acknowledges you and says :
  113.      'What can I do for you my son?'
  114.  
  115.   The pronouns will change based on gender and all that good gramatically
  116.   correct stuff.
  117.   That's some pretty nifty stuff, but it doesn't just stop there... I am
  118.   sure you will need to do a few more things with characters information 
  119.   aside from what their gender is.
  120.   
  121.   SCRIPTS.DOC                                                        Page  4
  122.   ─═════════════════════════════════════════════════════════════════════════─
  123.   About Character Related Variables:
  124.   
  125.   All of the following commands will give you some sort of information
  126.   about the character.  This all can be used just as has been described
  127.   before.  These can also be modified using the commands in the script.
  128.   (Like ADD and SET).  Obviously, string variables cannot be added to, but
  129.   can still be SET, (using SETSTR).  I don't allow scripts to change :
  130.   A.)Characters Real Name, or B.)Characters Level in any way shape or form.
  131.   Some of these variables I don't allow a SET command to be used on simply
  132.   because I'd rather you just Added to and subtracted from.  There are only
  133.   three (Attack,Defense, and Damage Reduction) so when you go to 
  134.   
  135.   Set ^CS03 4500 
  136.   
  137.   and it doesn't do anything, you'll know why.  The following is legal, though
  138.   
  139.   Add ^CS03 4500 
  140.   
  141.   It will add 4500 to attack, so I'm relying on you script writers not to 
  142.   make the game too easy.
  143.   
  144.   
  145.   Some of the variables work differently whether you are modifying it or just
  146.   displaying it.  The variable for guild is a good example.
  147.   
  148.   ^CS09 Will give you the name of the guild when used in a Write/Writeln
  149.         but the guild number is used everywhere else ^CS09 is found.  
  150.  
  151.         Refer to the next page for details on all the variables.
  152.  
  153.   SCRIPTS.DOC                                                        Page  5
  154.   ─═════════════════════════════════════════════════════════════════════════─
  155.   ^CS Variables : Their Numbers and their Meanings
  156.   
  157.   ^CS01   Name (same as ^CA)
  158.   ^CS02   *Real Name*
  159.             You cannot modify this variable at all.
  160.             Can only use in a Write type command or comparison.
  161.   ^CS03   Attack Value
  162.             You cannot use the Set command on this variable
  163.   ^CS04   Defense Value
  164.             You cannot use the Set command on this variable
  165.   ^CS05   Damage Reduction Value
  166.             You cannot use the Set command on this variable
  167.   ^CS06   Charm
  168.   ^CS07   Shame
  169.   ^CS08   Luck
  170.   ^CS09   * Guild*
  171.             When used in a Writeln, it will display the name of the guild.
  172.             You cannot use the Add command on this variable
  173.             When used in a Set, it is the guild # (Included in case you want
  174.             your script to say kick a character out of their guild, or only
  175.             allow guilded characters into a certain area)
  176.   ^CS10   Hit Points (Curr)
  177.   ^CS11   Hit Points (Max)
  178.   ^CS12   Current attack value of Equipped Weapon  (See ^CS29 for max)
  179.             Note : Increasing Weapon Value does not increase Attack Value
  180.   ^CS13   Name of currently Equipped Weapon
  181.   ^CS14   Current defense value of Equipped Armor  (See ^CS30 for max)
  182.             Note : Increasing Armor Value does not increase Defense Value
  183.   ^CS15   Name of currently Equipped Weapon
  184.   ^CS16   Current resistance value of Equipped Shield  (See ^CS31 for max)
  185.             Note : Increasing Shield Value does not increase Damage Reduction
  186.   ^CS17   Name of currently Equipped Weapon
  187.   ^CS18   Gold on Hand
  188.   ^CS19   Gold in Bank
  189.   ^CS20   Gems
  190.   ^CS21   Experience
  191.   ^CS22   *Characters Level*
  192.             You cannot modify this variable at all.
  193.             Can only use in a Write type command or comparison.
  194.   ^CS23   # of Skill Uses Curr
  195.   ^CS24   # of Skill Uses Max
  196.   ^CS25   *Characters Current location*
  197.             When used in a Writeln, the first character is ignored as it is
  198.             used to denote what type of zone the character is in.
  199.             You cannot use the Add or Set command on this variable
  200.             When used in a Location command, you must include the zone type
  201.             character (i.e. you would have Location "gGraveyard of Souls" as 
  202.             opposed to Location "Graveyard", it just wouldn't display right)
  203.   ^CS26   # of Creature Fights Left
  204.   ^CS27   # of Player Fights Left
  205.   ^CS28   Class
  206.             Only gives the current class of the character (Thief, Ranger etc)
  207.   ^CS29   Maximum attack value of Equipped Weapon  (See ^CS12 for curr)
  208.             Note : Increasing Weapon Value does not increase Attack Value
  209.   ^CS30   Maximum defense value of Equipped Armor  (See ^CS30 for curr)
  210.             Note : Increasing Armor Value does not increase Defense Value
  211.   ^CS31   Maximum resistance value of Equipped Shield  (See ^CS31 for curr)
  212.             Note : Increasing Shield Value does not increase Damage Reduction
  213.   SCRIPTS.DOC                                                        Page  6
  214.   ─═════════════════════════════════════════════════════════════════════════─
  215.   About Script Related Variables:
  216.  
  217.   What is a program that doesn't communicate with itself?  If it doesn't know
  218.   if you've opened the door, how is it supposed to know whether or not you can 
  219.   go through it?  Script Related variables fill this gap quite nicely.  You 
  220.   should have more than enough variables to do whatever you need to do in a 
  221.   script.
  222.   
  223.   There are 20 variables that can be displayed/set/setstr/add/mult whatever
  224.   you want to do til your heart's content.  Each variable can contain up to
  225.   80 bytes, which is more than plenty for any number you may want to store,
  226.   or just right if it is going to be used for output to the player.
  227.   
  228.   There are 29 more variables that are either 0 or 1 (False or True) (boolean
  229.   if that means anything to you) that can be used as flags to let the script
  230.   know that something has been performed (without having to waste a ton of
  231.   variable space on it).
  232.   
  233.   The script related variables are accessed just like character based
  234.   variables except they all start with ^VR.
  235.  
  236.   ^VR01 Script Variable #1
  237.   ^VR02 Script Variable #2
  238.   ....
  239.   ....
  240.   ^VR19 Script Variable #19
  241.   ^VR20 Script Variable #20
  242.  
  243.   Note again that you must have a leading 0 for 01-09.  Well, those aren't
  244.   the only variables that start with ^VR.... there are really  more variables
  245.   that have the prefix ^VR... They are special in that you cannot use them
  246.   in the Set/Setstr/Add/Mult command.  They contain certain parameters about
  247.   the game that have been set.  As you will learn, script files can read in
  248.   external creature files.  The script knows which file to read by reading
  249.   the command : CreatureFile NAME.EXT somewhere in the script file (I would
  250.   suggest putting it in the @#Define section (which you will learn about
  251.   later).  That creature file-name is stored as ^VR22.  There is a command
  252.   called DefaultCommand that is used to set up what input defaults to when
  253.   a prompt comes up.  Say you perfrom a DefaultCommand L.  Anytime thereafter
  254.   a prompt comes up, if the player just hits enter, the input will actually
  255.   be L.  This will be the case until the DefaultCommand is called again.
  256.   The default command is stored in ^VR21.  To sum it up, the "special"
  257.   variables are :
  258.  
  259.   ^VR21   The current default command.
  260.             This command is set using the DefaultCommand command
  261.   ^VR22   The current creature file to read creatures from.
  262.             This command is set using the CreatureFile command
  263.   ^VR23   Stores the Character Boolean flags.  (See the ^GF variables)
  264.   ^VR24   The current menu file to read menus from.
  265.             This command is set using the MenuFile command
  266.   ^VR25   The current item file to read items from.
  267.             This command is set using the ItemFile command
  268.  
  269.   Note : These commands can only be used in a Write/Writeln/ or comparison.
  270.   (See the corresponding command in the commands section for more details)
  271.   SCRIPTS.DOC                                                        Page  7
  272.   ─═════════════════════════════════════════════════════════════════════════─
  273.   About Boolean Variables:
  274.   
  275.   Remember I talked about those variables that could be 0 or 1?  Well, I call
  276.   those Game Flags, hence the reason they are accessed using the ^GF prefix.
  277.   There are currently 29 of those available (believe it or not, that is not
  278.   just an arbitrary number).  These can be used for numerous things.  I use
  279.   them to tell the script whether the player has performed a certain action
  280.   or not.  Like for instance, whether they have examined the door in the room
  281.   or not (hint if you need it in The Crypt of Lord Hamilton)...
  282.   This type of variable cannot be used in Add/Setstr, but can be used in
  283.   Set/Write/Writeln/or comparisons.  Note, that it can only be set to 0 or 1.
  284.   Note again that you must have a leading 0 for 01-09.
  285.  
  286.   ^GF01 Game Flag #1
  287.   ^GF02 Game Flag #2
  288.   ....
  289.   ....
  290.   ^GF28 Game Flag #28
  291.   ^GF29 Game Flag #29
  292.  
  293.   Any ^GF variable can only be 0 or 1 (maybe 2, but I wouldn't push it, the
  294.   computer may decide it doesn't want to compute anymore ;)
  295.  
  296.   ─═════════════════════════════════════════════════════════════════════════─
  297.   About Boolean Variables - The Character Flags :
  298.  
  299.   Each character has a series of flags that the game keeps track of (29
  300.   to be exact... hmmm, haven't I seen 29 of something before? hint : 29
  301.   is the limit of booleans available in a longint :)  Anyway, these are
  302.   alot like the Game Flags I just talked about, except that these are used
  303.   by the main portion of the game as well, and stored in the character
  304.   file.  There really isn't a need to be setting these, but it is okay to
  305.   look at them (to see if say, the character is drunk ;) and use them in
  306.   a script.  They are accessed using the ^CX prefix.  This variable will
  307.   be either a 0 or a 1.  Note, a leading zero is necessary for 01-09.
  308.  
  309.   ^CX01 Character Flag #1
  310.   ^CX02 Character Flag #2
  311.   ....
  312.   ....
  313.   ^CX28 Character Flag #28
  314.   ^CX29 Character Flag #29
  315.   SCRIPTS.DOC                                                        Page  8
  316.   ─═════════════════════════════════════════════════════════════════════════─
  317.   Construction of a script:
  318.  
  319.   Scripts are pretty easy-going as far as layout goes.  The sections do
  320.   not need to be in a particular order, upper/lowercase is ignored for 
  321.   section names and variables etc.  Sections are defined in the script
  322.   file by putting the characters @# at the start of a line and the section
  323.   name of the script immediately following.  If I wanted a section for
  324.   fighting creatures in my script, I might call it Fight and would therefore
  325.   have a section in my script defined as the following :
  326.  
  327.   @#Fight
  328.  
  329.   To designate the end of the file, put a @# as the last line in the script.
  330.   While the physical order of the sections in the script file has no bearing
  331.   on its functionality, there is a certain order of execution that is built
  332.   into the interpretter.  The script begins execution by looking for the
  333.   @#DEFINE section.  It is not necessary to have a define section, but this
  334.   section is special in that it is only looked at once, and therefore, any
  335.   variables that are to be used to keep track of something important should
  336.   be initialized here.  Also, using the Location <name> command in the define
  337.   section is a good idea so that the character doesn't appear to be stuck at
  338.   the town square <G>.  I would also set the inital CreatureFile here so you
  339.   don't forget to do it.
  340.  
  341.   There are some section names that have a special meaning to the script
  342.   language.  I've already mentioned the define section.  The Define section
  343.   is the first section the game looks at in a script.  After it reads and
  344.   executes all the commands in the Define section, it jumps to the section
  345.   in the script with the name "Main" (without the quotes) and begins the
  346.   main section of the game.  
  347.   
  348.   NOTE : Every section in the script file that is to be executed can be
  349.   thought of as a never-ending loop, and without a return or a halt command 
  350.   somewhere within the section, you will never leave it. (exception @#DEFINE)
  351.  
  352.   *** NEW 1.07 ***
  353.   As of version 1.07, the MagiCfg program contains a new section used for
  354.   ExMod additions and removals and modifications.  It is possible to add any
  355.   program under the TMG directory to the 'Other Realms' menu using this
  356.   feature.  In addition, built in is the ability to read either the script
  357.   or a special description file to retrieve both the name of the ExMod and
  358.   the description and add those to the Other Realms menu.  To accomplish this
  359.   within a script is simple.  Add a section to the script that looks like
  360.   the following example:
  361.  
  362.   @#INSTALL
  363.   <The name of the script goes on the first line>
  364.   <The description of the script continues after that>
  365.   <...>
  366.   <...>
  367.   <End of description>
  368.   @#OTHER_SECTIONS
  369.  
  370.   SCRIPTS.DOC                                                        Page  9
  371.   ─═════════════════════════════════════════════════════════════════════════─
  372.  
  373.   It is nearly as easy to do this for programs that do not end in .SCR which
  374.   include compiled scripts, Executable programs and/or batch files.  Create
  375.   a file with the same name as your program but use a .DSC extension.  Within
  376.   that file include the following:
  377.  
  378.   @#INSTALL
  379.   <The name of the script goes on the first line>
  380.   <The description of the script continues after that>
  381.   <...>
  382.   <...>
  383.   <End of description>
  384.   @#
  385.  
  386.   Looks just like the example for the scripts because it actually reads it
  387.   the exact same way.  If this method was not included with a ExMod then
  388.   it installs the ExMod with a generic name and no description.  These can
  389.   then be easily modified.
  390.  
  391.   ─═════════════════════════════════════════════════════════════════════════─
  392.   @#MONSTER
  393.  
  394.   Another section name the game could look into is @#MONSTER which is where
  395.   you define any monsters internal to the script.
  396.  
  397.   NOTE : Using internal creatures is the only way to guarantee exactly which
  398.   creature a character will fight at any given time, so if you have a "boss"
  399.   at the end of your script, make him/her an internal creature.
  400.  
  401.   The following is how you would define an internal creature.  The second 
  402.   word on any of the lines must be the creatures internal number (The number
  403.   you pass to Combat when you want the player to fight an internal monster.
  404.  
  405.   STATS <num> <attack> <defense> <shield> <exp> <gold> <hit points> <level>
  406.   NAME  <num> "<Monsters Name>"
  407.   WNAME <num> "<Monsters Weapon Name>"
  408.   ANAME <num> "<Monsters Armor Name>"
  409.   DEATH <num> "<Monsters Death Line>"
  410.  
  411.   Those lines do not have to be in any particular order (I just remember them
  412.   that way ;) But you must have all 5 lines present to get a complete monster.
  413.  
  414.   ─═════════════════════════════════════════════════════════════════════════─
  415.   @#ITEMS
  416.  
  417.   As of Version 1.07, there is another "special" section in a script file :
  418.   @#ITEMS
  419.   This is where you will define all the items that are going to be given away
  420.   in your script.
  421.  
  422.   The following is how you would define an item.  The second  word on any of
  423.   the lines must be the items number (The number you pass to Item when you
  424.   want to give that item to the player).  These numbers have no meaning at
  425.   all outside the script, it is just for internal reference.
  426.  
  427.   NAME  <num> "<Item Name>"
  428.   SCRID <num> "<Item ScriptID>"
  429.   STAT1 <num> attack maxattack cost charges wear_location
  430.   STAT2 <num> required_level item_flags identified?
  431.   SCRIPTS.DOC                                                        Page 10
  432.   ─═════════════════════════════════════════════════════════════════════════─
  433.   Item Definitions:
  434.  
  435.   Okay, and so you know what those values should be, here are their
  436.   definitions.
  437.     Item Name - This is the name the character sees in his inventory and is
  438.              used for all display purposes.
  439.     Item ScriptID - This is a unique code that you (the creator) assign to
  440.              the item you create.  This is what it will be referenced with
  441.              in the database file.  The standard formula for this should
  442.              be as follows:  LLLL-MMDDYYYY-LL-L
  443.                LLLL is 4 characters to identify the item
  444.                MM is the 2 digit month the item was created
  445.                DD is the 2 digit day of the month the item was created
  446.                YYYY is the 4 digit year the item was created
  447.                LL are the creators initials
  448.                L is either Y or N - Y allows other items to access your items
  449.                 scripts as if they were its own. N means nothing else can use
  450.                 the scripts for this item.
  451.     Attack - The value the item adds to your combat value.  This is the
  452.              attack value for weapons, defense for armor, and damage resistance
  453.              for shields.  This should be 0 for all non weapon/armor/shields.
  454.     MaxAttack - The maximum value the item can add to your combat value.
  455.              (see Attack above for more information as well.)
  456.     Cost -   What you would pay for this item if you were to buy it in one
  457.              of the shops. (also what selling it is based upon)
  458.     Charges - This is how many times the item can be used.  Charges are
  459.              subtracted from the item on any "USE", "ONDEATH", or "USECOMBAT"
  460.              When the last charge is used, that fires the "LASTUSE" script
  461.              if the item has one
  462.     Wear_Location - What type of item is this, and where can I equip it?
  463.              This will be a number that corresponds to one of the following:
  464.  
  465.                  1 -    Head                    6 -     Feet
  466.                  2 -    Neck                    7 -     Weapon
  467.                  3 -    Armor                   8 -     Shield
  468.                  4 -    Hands                   9 -     Treasure
  469.                  5 -    Ring                    10 -    Other
  470.  
  471.     Required_Level - The level the character must be to use this item.
  472.     Item_Flags - These are miscellaneous special effects that the object can
  473.              have, and can be used to make the item unique
  474.  
  475.                  1 -    Item Disappers on its final use (potions etc...)
  476.                  2 -    Silver (useful against werewolves etc)
  477.                  4 -    Magic +1 (certain monsters require at least a magical
  478.                  8 -    Magic +2  item to be hit.  Monsters will have the
  479.                  16 -   Magic +3  same flags for to be hit.)
  480.                  (more to come)
  481.  
  482.     Identified - Does the character recognize this item for what it is as
  483.              soon as he/she gets it, or do they need to Identify it?
  484.              Values for this are:
  485.                  0 -    Not Identified          1 -     Identified
  486.  
  487.   SCRIPTS.DOC                                                        Page 11
  488.   ─═════════════════════════════════════════════════════════════════════════─
  489.   Setting up Item Scripts:
  490.  
  491.   There are currently 10 different actions you can apply to your items.
  492.   They are in their own section of the script denoted with the following
  493.   syntax
  494.   @#ITEM<NUM>_<ACTION>
  495.     ......
  496.     ......
  497.   @#ITEM<NUM>_<ACTION>
  498.     etc..
  499.  
  500.   Where NUM is the item number as it is defined in the @#ITEMS section
  501.   (NAME 1 "Sword of Killing" would be designated as @#ITEM1_<ACTION>)
  502.   and where <ACTION> is on what type of event the script for that section
  503.   goes off.  The list of Actions is as follows :
  504.  
  505.         WEAR           *ONATTACK                USECOMBAT
  506.         USE            *ONDAMAGE                IDENTIFY
  507.         REMOVE        **ONDEATH                 LASTUSE
  508.         DROP
  509.  
  510.   *This command is not yet implemented, but here to show how much can be
  511.    done with the system
  512.  **This command currently only triggers on death in a creature fight (not
  513.    a master level up fight or a player fight)
  514.  
  515.   Example of a Potion of Healing:
  516.   @#ITEMS
  517.     NAME  1 "`2Potion of Healing"
  518.     SCRID 1 "PofH-04111997-JO-N"
  519.     STAT1 1 0 0 2500 1 10
  520.     STAT2 1 1 1 0
  521.   @#ITEM1_USE
  522.     Writeln "`3  You take a drink of the Potion of Healing and a warm fire"
  523.     Writeln "shoots through your body.  It magically heals your wounds and"
  524.     Writeln "completely heals you."
  525.     Set ^CS10 ^CS11
  526.   @#ITEM1_USECOMBAT
  527.     Gosub USE
  528.   @#ITEM1_IDENTIFY
  529.     Writeln "`3  The Potion of Healing will restore your Hit Points to Maximum when"
  530.     Writeln "  the potion is used."
  531.     Writeln "`9  (`%Heals all wounds`9)"
  532.   @#ITEM1_LASTUSE
  533.     Writeln "`9  (`%The vial is now empty`9)"
  534.  
  535.   This item would have the following information:
  536.      Name      : (Green)Potion of Healing(Green)
  537.      Script ID : PofH-04111997-JO-N
  538.      Attack    : 0
  539.      Max Attack: 0
  540.      Cost      : 2500
  541.      # Charges : 1
  542.      Worn at   : Other
  543.      Req. Level: 1
  544.      Flags     : Disappears after its last use
  545.      Ifentified: No
  546.      Scripts   : USE USECOMBAT IDENTIFY LASTUSE
  547.   SCRIPTS.DOC                                                        Page 12
  548.   ─═════════════════════════════════════════════════════════════════════════─
  549.   Example of a script:
  550.  
  551. @#Define
  552.   CreatureFile MYGRAVE.DAT
  553.   Set ^VR19 0
  554.   Set ^VR20 0
  555.   Location "gMt. Dead Graveyard"
  556. @#MAIN_MENU
  557. EGL
  558. `c                               `%Gates of Mt. Dead :
  559. `#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  560. `9  You stand before the looming gates of Mt. Dead, the notorious place to
  561. `9  find all manner of creature living or dead.  Can you handle what this
  562. `9  place will throw at you?
  563. `3
  564. `3  (`#E`3)xamine the Gates.
  565. `3  (`#G`3)o Boldly In.
  566. `3  (`#L`3)eave this scary place.
  567. @#MAIN
  568.   Menu MAIN_MENU
  569.   Writeln ""
  570.   Writeln "   `%Mount Dead :"
  571.   DefaultCommand G
  572.   ReadMenuCommands ^VR01
  573.   Writeln "^VR01"
  574.   If ^VR01 == E
  575.     Writeln "`!  You see nothing unusual about the gates."
  576.   Endif
  577.   If ^VR01 == G
  578.     Gosub DEAD1
  579.   Endif
  580.   If ^VR01 == L
  581.     Halt
  582.   Endif
  583.   If ^VR01 == R
  584.     DisplayRanks
  585.   Endif
  586.   If ^VR01 == V
  587.     DisplayStats
  588.   Endif
  589.   If ^VR01 == F
  590.     FindPlayers
  591.   Endif
  592. @#
  593.  
  594.   Note : The section that contains the menu and the section that contains
  595.   executable code are defined the exact same way.  The only difference is
  596.   the way they are accessed.  A Menu is brought to the user and displayed
  597.   through use of the Menu command, a sub-section is made current with the
  598.   Gosub/Return Command.
  599.   SCRIPTS.DOC                                                        Page 13
  600.   ─═════════════════════════════════════════════════════════════════════════─
  601.   Command Index:
  602.  
  603.   Command                                                            Page
  604.  
  605.   Add................................................................  14
  606.   Combat.............................................................  14
  607.   CreatureFile.......................................................  15
  608.   DefaultCommand.....................................................  15
  609.   DisplayCreatures...................................................  15
  610.   DisplayGameStats...................................................  16
  611.   DisplayMenu........................................................  16
  612.   DisplayRanks.......................................................  16
  613.   DisplayScriptInfo..................................................  17
  614.   DisplayScriptText..................................................  17
  615.   DisplayStats.......................................................  17
  616.   FindPlayers........................................................  18
  617.   Gosub..............................................................  18
  618.   GotoXY.............................................................  18
  619.   Halt...............................................................  19
  620.   Healer.............................................................  19
  621.   If/Endif...........................................................  19
  622.   Inventory..........................................................  20
  623.   Item...............................................................  21
  624.   ItemFile...........................................................  21
  625.   Location...........................................................  22
  626.   Mail/MailCommands/EndMail..........................................  22
  627.   Menu...............................................................  23
  628.   MenuFile...........................................................  23
  629.   MessageBoard.......................................................  23
  630.   MonsterAvailable...................................................  24
  631.   Mult...............................................................  24
  632.   Pause..............................................................  24
  633.   Random.............................................................  25
  634.   ReadChar...........................................................  25
  635.   ReadLine...........................................................  25
  636.   ReadMenuCommands...................................................  26
  637.   ReDispMenu.........................................................  26
  638.   Return.............................................................  27
  639.   Set................................................................  27
  640.   SetStr.............................................................  27
  641.   SharedEvent........................................................  28
  642.   Write..............................................................  28
  643.   Writeln............................................................  29
  644.   WriteBlock/EndBlock................................................  29
  645.   
  646.   ─═════════════════════════════════════════════════════════════════════════─
  647.   Flag Related Commands
  648.  
  649.   AddFlag............................................................  30
  650.   RemoveFlag.........................................................  31
  651.   FlagValue..........................................................  32
  652.  
  653.   SCRIPTS.DOC                                                        Page 14
  654.   ─═════════════════════════════════════════════════════════════════════════─
  655.   Command Descriptions :
  656.  
  657.     Add
  658.   ────────────────────────────────────────────────────────
  659.   Syntax :      Add <Variable> <Amount>
  660.  
  661.   Description : Adds the amount specified in the second parameter to
  662.                 the variable specified in the first parameter.
  663.  
  664.   Notes :       <Variable> can be any type of variable from the ^VR
  665.                 or ^CS fields that contains an integer value.  There
  666.                 are also a few other fields which are excluded.
  667.                 <Amount> can be a literal (i.e. 2, 8, 32000 etc.) or
  668.                 it can be a variable from the ^VR or ^CS or ^GF
  669.                 fields that contains an integer value.  A negative
  670.                 sign in front of the literal, or variable will tell
  671.                 the routine to SUBTRACT the amount from the variable.
  672.  
  673.   Exclusions :  <Variable> cannot be :
  674.                 ^CS01 ^CS02 ^CS09 ^CS13 ^CS15 ^CS17 ^CS22 ^CS25
  675.  
  676.   Examples :
  677.                 Add ^CS18 320
  678.                 Add ^CS10 -5
  679.                 Add ^CS10 -^VR03 (Assuming ^VR03 has an integer in it)
  680.                 Add ^VR18 ^CS26
  681.  
  682.  
  683.     Combat
  684.   ────────────────────────────────────────────────────────
  685.   Syntax :      Combat <Variable> Int/Ext | <Creature Number>
  686.  
  687.   Description : Puts the player into combat versus a creature.
  688.                 Saves the result of the combat in <Variable>.
  689.                 Variable will be :
  690.                  0  :  Character ran away from creature.
  691.                  1  :  Character defeated creature.
  692.                  2  :  No creature was available (level/<num> error)
  693.  
  694.   Notes :       This is the one routine where you can have a
  695.                 ^GF variable equal to 2.  I would not suggest
  696.                 doing it on a frequent basis, but, it does the job.
  697.                 Int/Ext, set to Int and include the
  698.                 <Creature Number> to have the creature the player
  699.                 fights to be a specific creature in the @#MONSTERS
  700.                 section of the script file.  Set to Ext to have
  701.                 the script pick a random monster of the players
  702.                 level from the filename stored using CreatureFile.
  703.  
  704.   Exclusions :  Don't use any of the ^CS variables as the <Variable>
  705.                 That's just asking for trouble.
  706.  
  707.   Examples :    
  708.                 Combat ^VR19 Ext
  709.                 Combat ^GF26 Ext
  710.                 Combat ^GF29 Int 1
  711.                 Combat ^VR14 Int 8
  712.   SCRIPTS.DOC                                                        Page 15
  713.   ─═════════════════════════════════════════════════════════════════════════─
  714.   Command Descriptions :
  715.  
  716.     CreatureFile
  717.   ────────────────────────────────────────────────────────
  718.   Syntax :      CreatureFile <FileName>
  719.  
  720.   Description : Assigns the external file to read creatures from
  721.                 when a Combat Ext command is executed.
  722.  
  723.   Notes :       Usually this will not change throughout the course
  724.                 of the script.  I recommend putting this command
  725.                 in the @#Define section of the script to avoid
  726.                 executing it every loop.
  727.  
  728.   Examples :    
  729.                 CreatureFile FOREST.DAT
  730.                 CreatureFile CRYPT.DAT
  731.  
  732.     
  733.     DefaultCommand
  734.   ────────────────────────────────────────────────────────
  735.   Syntax :      DefaultCommand <Command>
  736.  
  737.   Description : Assigns what command is chosen when the player
  738.                 strikes enter at the input lines thereafter.
  739.  
  740.   Notes :       <Command> can be any variable, including menu
  741.                 commands ^MC##, ^GF##, ^CS##, ^VR##.  If the
  742.                 default command is set to more than one character
  743.                 and a ReadChar is encountered, only the first
  744.                 character in <Command> will be executed.
  745.  
  746.   Examples :    
  747.                 DefaultCommand L
  748.                 DefaultCommand ^MC02
  749.                 DefaultCommand ^CS18
  750.                   (Will make the default command the amount of
  751.                    gold they have on them (good for donations))
  752.                 DefaultCommand ^VR12
  753.  
  754.  
  755.     DisplayCreatures
  756.   ────────────────────────────────────────────────────────
  757.   Syntax :      DisplayCreatures
  758.  
  759.   Description : This command will bring up a display of all the
  760.                 creatures currently loaded into the script.
  761.  
  762.   Notes :       This command is here for test purposes really.
  763.                 Use it when you want to see what creatures are
  764.                 available for the combat routine
  765.                 (Currently only works with EXTernal creatures)
  766.   SCRIPTS.DOC                                                        Page 16
  767.   ─═════════════════════════════════════════════════════════════════════════─
  768.   Command Descriptions :
  769.  
  770.     DisplayGameStats
  771.   ────────────────────────────────────────────────────────
  772.   Syntax :      DisplayGameStats
  773.  
  774.   Description : This command will bring up a display of all the
  775.                 statistics of the game, saved in the MAGISTAT.DAT
  776.                 file.
  777.  
  778.   Notes :       This command includes most any stat about the game
  779.                 you would want or need to know, including how many
  780.                 characters are in the game, deletion period etc.
  781.  
  782.  
  783.     DisplayMenu
  784.   ────────────────────────────────────────────────────────
  785.   Syntax :      DisplayMenu
  786.  
  787.   Description : This command will display the menu loaded into
  788.                 into the current section of the script to the player.
  789.  
  790.   Notes :       This command is best used after the ReadMenuCommands
  791.                 command in an If statement.  I have always used ?
  792.                 as the command to redisplay the menu
  793.                 
  794.   Example :     
  795.                 Menu Main_menu
  796.                 ReadMenuCommands ^VR01
  797.                 If ^VR01 == ?
  798.                   DisplayMenu
  799.                 Endif
  800.  
  801.     
  802.     DisplayRanks
  803.   ────────────────────────────────────────────────────────
  804.   Syntax :      DisplayRanks
  805.  
  806.   Description : This command is used to display the rankings of
  807.                 the players to the player.
  808.  
  809.   Notes :       This is a call to the same command the main part
  810.                 of the game calls.  I would use an R as the command
  811.                 to display the ranks.
  812.  
  813.   Example :     
  814.                 Menu Main_menu
  815.                 ReadMenuCommands ^VR01
  816.                 If ^VR01 == R
  817.                   DisplayRanks
  818.                 Endif
  819.   SCRIPTS.DOC                                                        Page 17
  820.   ─═════════════════════════════════════════════════════════════════════════─
  821.   Command Descriptions :
  822.  
  823.     DisplayScriptInfo
  824.   ────────────────────────────────────────────────────────
  825.   Syntax :      DisplayScriptInfo
  826.  
  827.   Description : This command should be used for debugging a script.
  828.                 It will display the section of the script it is
  829.                 currently running, the creature file, the current
  830.                 default command and the contents of the 49 variables.
  831.  
  832.   Note :        Do not include this in the final version of the
  833.                 script as it could give a player quite a bit of
  834.                 insight into the script (which it does give)
  835.  
  836.  
  837.     DisplayScriptText
  838.   ────────────────────────────────────────────────────────
  839.   Syntax :      DisplayScriptText
  840.  
  841.   Description : This command should be used for debugging a script. 
  842.                 It will display the actual text in that section of
  843.                 the script.
  844.  
  845.   Note :        Do not include this in the final version of the
  846.                 script as it could give a player a look at all of
  847.                 the commands in the current section.  This is good
  848.                 for figuring out if something is out of place in
  849.                 the script.
  850.  
  851.   Example :     
  852.                 Menu Main_menu
  853.                 ReadMenuCommands ^VR01
  854.                 If ^VR01 == -
  855.                   DisplayScriptText
  856.                 Endif
  857.  
  858.     
  859.     DisplayStats
  860.   ────────────────────────────────────────────────────────
  861.   Syntax :      DisplayStats
  862.  
  863.   Description : This command is used to display the statistics
  864.                 of the character to the player.
  865.  
  866.   Notes :       This is a call to the same command the main part
  867.                 of the game calls.  I would use a V as the command
  868.                 to display the stats.
  869.  
  870.   Example :     
  871.                 Menu Main_menu
  872.                 ReadMenuCommands ^VR01
  873.                 If ^VR01 == V
  874.                   DisplayStats
  875.                 Endif
  876.   SCRIPTS.DOC                                                        Page 18
  877.   ─═════════════════════════════════════════════════════════════════════════─
  878.   Command Descriptions :
  879.  
  880.     FindPlayers
  881.   ────────────────────────────────────────────────────────
  882.   Syntax :      FindPlayers
  883.  
  884.   Description : This command is used to display the current
  885.                 location of all players currently in the game.
  886.  
  887.   Notes :       This is a call to the same command the main part
  888.                 of the game calls.  I would use a F as the command
  889.                 to display the stats.
  890.  
  891.   Example :     
  892.                 Menu Main_menu
  893.                 ReadMenuCommands ^VR01
  894.                 If ^VR01 == F
  895.                   FindPlayers
  896.                 Endif
  897.  
  898.  
  899.     Gosub
  900.   ────────────────────────────────────────────────────────
  901.   Syntax :      Gosub <SectionName>
  902.  
  903.   Description : This command is used to jump from one section
  904.                 in the script file to another.
  905.  
  906.   Notes :       This is a great way to seperate "rooms" in the
  907.                 game, or put a commonly used set of commands in
  908.                 its own section and have whatever needs to access
  909.                 it call it with a Gosub/Return (see the corresponding
  910.                 section on Return as well).  Be sure not to gosub to
  911.                 a section you have written as a menu section.
  912.  
  913.   Example :     
  914.                 Menu Main_menu
  915.                 ReadMenuCommands ^VR01
  916.                 If ^VR01 == D
  917.                   Gosub DoSomething
  918.                 Endif
  919.                 If ^VR01 == K
  920.                   Gosub KillSomething
  921.                 Endif
  922.  
  923.  
  924.     GotoXY
  925.   ────────────────────────────────────────────────────────
  926.   Syntax :      GotoXY <X coord.> <Y coord.>
  927.  
  928.   Description : This command jumps the cursor to the screen
  929.                 coordinates specified in the X and Y coords.
  930.  
  931.   Note :        This can be used to make screens with text
  932.                 placed anywhere necessary without using a
  933.                 ton of Writeln "" 's.
  934.  
  935.   Example :     GotoXY 1 1
  936.                 This will take the cursor to the home position.
  937.   SCRIPTS.DOC                                                        Page 19
  938.   ─═════════════════════════════════════════════════════════════════════════─
  939.   Command Descriptions :
  940.  
  941.     Halt
  942.   ────────────────────────────────────────────────────────
  943.   Syntax :      Halt
  944.  
  945.   Description : This command is used to stop the execution
  946.                 of the script.
  947.  
  948.   Notes :       Halt can be placed anywhere in the script as
  949.                 well as as many occurances of it as are necessary.
  950.  
  951.  
  952.     Healer
  953.   ────────────────────────────────────────────────────────
  954.   Syntax :      Healer
  955.  
  956.   Description : This command will take the character to the
  957.                 healers hut and return them exactly where they
  958.                 were when they entered.
  959.  
  960.   Notes :       This is a call to the same command the main part
  961.                 of the game calls.
  962.  
  963.  
  964.     If/EndIf
  965.   ────────────────────────────────────────────────────────
  966.   Syntax :      If <variable1> <operator> <variable2>
  967.  
  968.   Description : These commands are used to make a decision within
  969.                 the script.
  970.  
  971.   Notes :       This command is a major portion of what a script 
  972.                 does.  It can determine what letter is stored
  973.                 within a certain variable, whether a characters 
  974.                 hit points/level/luck is equal to or less than, or
  975.                 greater than a certain number/variable.
  976.                 Variables of all types are allowed on BOTH sides of
  977.                 the operator.
  978.                 Operater is one of the following
  979.  
  980.                 If a == b       a is equal to b
  981.                 If a <> b       a is not equal to b
  982.                 If a >= b       a is greater than or equal to b
  983.                 If a <= b       a is less than or equal to b
  984.                 If a > b        a is greater than b
  985.                 If a < b        a is less than b
  986.  
  987.                 Note that there must be 3 seperate "words" on the
  988.                 line (A space must exist between the variables and the
  989.                 operator)
  990.  
  991.                 If a statement is found to be true, everything until the
  992.                 next EndIf is executed.  If it is false, the script finds
  993.                 the command immediately following the next EndIf and begins
  994.                 executing from that point onward.
  995.   SCRIPTS.DOC                                                        Page 20
  996.   ─═════════════════════════════════════════════════════════════════════════─
  997.   Command Descriptions :
  998.  
  999.     If/EndIf continued.
  1000.   ────────────────────────────────────────────────────────
  1001.   Notes :       If can be used to compare all manners of variables,
  1002.                 whether they contain numbers or strings, it will 
  1003.                 work with it.  Be warned though, the only operators
  1004.                 that you should used with string are the == and the <>.
  1005.                 You can use the other operators with strings, but
  1006.                 if you are not sure of what you are doing, you may
  1007.                 get unexepected results.
  1008.  
  1009.   Example :     Menu MainMenu
  1010.                 ReadMenuCommands ^VR01
  1011.                 Writeln "^VR01"
  1012.                 If ^VR01 == A
  1013.                   Writeln "Hey, you hit A"
  1014.                 Endif
  1015.                 If ^VR01 == L
  1016.                   Writeln "Hey, you hit L"
  1017.                 Endif
  1018.                 If ^VR01 >= 1
  1019.                   If ^VR01 <=9
  1020.                     Write "^VR01 squared = "
  1021.                     Mult ^VR01 ^VR01
  1022.                     Writeln "^VR01"  
  1023.                   Endif
  1024.                 Endif
  1025.  
  1026.  
  1027.     Inventory
  1028.   ────────────────────────────────────────────────────────
  1029.   Syntax :      Inventory
  1030.  
  1031.   Description : This command brings up the (Y)our Inventory screen that
  1032.                 is accessible from the main menu and allows you to identify,
  1033.                 equip, remove, and drop items.
  1034.  
  1035.   Notes :       This command should be accessible from any main menu within
  1036.                 a script file.
  1037.  
  1038.   SCRIPTS.DOC                                                        Page 21
  1039.   ─═════════════════════════════════════════════════════════════════════════─
  1040.   Command Descriptions :
  1041.  
  1042.     Item
  1043.   ────────────────────────────────────────────────────────
  1044.   Syntax :      Item <Item Number> [NODISPLAY]
  1045.  
  1046.   Description : This command gives the character the item in the script
  1047.                 that is specified by <Item Number>.
  1048.  
  1049.   Notes :       This item must exist in the @#ITEMS section of the script
  1050.                 or the @#ITEMS section of the file specified in the ItemFile
  1051.                 command (see ItemFile).  If the item has never been given out
  1052.                 before, the game will create an Item Registry entry for it in
  1053.                 ITEMS.DAT and will create the script to go along with the item
  1054.                 in the items/ subdirectory.  See the section on Item Definition
  1055.                 for full details on how to create the item definition
  1056.                 a script file.
  1057.                 If you put a NODISPLAY as the second parameter (after the
  1058.                 item number), TMG will _NOT_ output anything to the user,
  1059.                 but will let your script do all of that.
  1060.  
  1061.   Example :
  1062.                 Item 1
  1063.                 Item ^VR04
  1064.                 Item 3 NODISPLAY
  1065.  
  1066.  
  1067.     ItemFile
  1068.   ────────────────────────────────────────────────────────
  1069.   Syntax :      ItemFile <FileName>
  1070.  
  1071.   Description : Assigns the external file to read item from when an
  1072.                 Item command is issued (see Item)
  1073.  
  1074.   Notes :       Usually this will not change throughout the course
  1075.                 of the script.  I recommend putting this command
  1076.                 in the @#Define section of the script to avoid
  1077.                 executing it every loop.
  1078.  
  1079.   Examples :    
  1080.                 ItemFile FOREST.ITM
  1081.                 ItemFile CRYPT.ITM
  1082.  
  1083.  
  1084.   SCRIPTS.DOC                                                        Page 22
  1085.   ─═════════════════════════════════════════════════════════════════════════─
  1086.   Command Descriptions :
  1087.  
  1088.     Location
  1089.   ────────────────────────────────────────────────────────
  1090.   Syntax :      Location "<location name>"
  1091.  
  1092.   Description : This command sets the characters location to whatever
  1093.                 is contained within the quotation marks.
  1094.  
  1095.   Notes :       The area type character must be included in this command.
  1096.                 The available area type characters are :
  1097.                 
  1098.                 B       -Generic Building               C       -Cave
  1099.                 D       -Dungeon                        F       -Forest
  1100.                 G       -Graveyard                      H       -Guild Hall
  1101.                 K       -Castle                         M       -Mountains
  1102.                 R       -Road                           S       -Shop
  1103.                 T       -Town                           I       -Inventory
  1104.  
  1105.                 The Location of the character can change as often as
  1106.                 you need it to.  This can be useful in case you are writing
  1107.                 a script as say a forest, and you have a main boss that you
  1108.                 want the all character to fight without the special ranger
  1109.                 power for the forest, set the location (temporarily) to
  1110.                 "T<script name>" and the power will be disabled.
  1111.  
  1112.     Mail/MailCommands/EndMail
  1113.   ────────────────────────────────────────────────────────
  1114.   Syntax :      Mail <to> <from>
  1115.                 <Mailbody>
  1116.                 ....
  1117.                 ....
  1118.                 MailCommands
  1119.                 <Commands>
  1120.                 ....
  1121.                 ....
  1122.                 EndMail
  1123.  
  1124.   Description : This sequence of commands is used to put mail in the
  1125.                 file for the character specified in <to> from <from>
  1126.                 with <Mailbody> as the text and execute whatever
  1127.                 commands are in the <Commnads> section.
  1128.  
  1129.   Notes :       The <To> portion of the mail command can only be one
  1130.                 word.  This shouldn't be a problem since you will more
  1131.                 than likely be using a variable for that.  The <from>
  1132.                 portion, however, does not have that limitation.  <from>
  1133.                 can be a variable, it can be a literal, and does not
  1134.                 need enclosing quotation marks.  I picture using a variable
  1135.                 here most often as well.
  1136.     
  1137.   Example :     Mail ^CS01 System Message :
  1138.                 `9You have been penalized by the gods for your insubordination.
  1139.                 `9You lose EVERYTHING!
  1140.                 MailCommands
  1141.                 Set ^CS18 0
  1142.                 Set ^CS19 0
  1143.                 Set ^CS20 0
  1144.                 EndMail
  1145.   SCRIPTS.DOC                                                        Page 23
  1146.   ─═════════════════════════════════════════════════════════════════════════─
  1147.   Command Descriptions :
  1148.  
  1149.     Menu
  1150.   ────────────────────────────────────────────────────────
  1151.   Syntax :      Menu <MenuName>
  1152.  
  1153.   Description : This command sets a certain section of the script file
  1154.                 as the menu to be displayed to the character for the
  1155.                 section of the script the game is currently executing.
  1156.  
  1157.   Notes :       Make sure you don't set an executable section of the
  1158.                 script as a menu in the game (would look a bit silly
  1159.                 to the user ;)
  1160.  
  1161.   Example :     Menu FOREST_TREES
  1162.                 Menu Enter_Building
  1163.  
  1164.     MenuFile
  1165.   ────────────────────────────────────────────────────────
  1166.   Syntax :      MenuFile <FileName>
  1167.  
  1168.   Description : Assigns the external file to read menus from
  1169.                 when a menu command is executed.
  1170.  
  1171.   Notes :       Usually this will not change throughout the course
  1172.                 of the script.  This variable defaults to the script
  1173.                 file itself, so if you put all of your menus in the main
  1174.                 script file, you should not set this.
  1175.  
  1176.   Examples :    
  1177.                 MenuFile FOREST.MNU
  1178.                 MenuFile CRYPT.MNU
  1179.  
  1180.  
  1181.     MessageBoard
  1182.   ────────────────────────────────────────────────────────
  1183.   Syntax :      MessageBoard <Number> <Title of Board>
  1184.  
  1185.   Description : This command will allow the user to read and post messages
  1186.                 on a bulletin board.
  1187.  
  1188.   Notes :       The number is the key as to which bulletin board it is,
  1189.                 not the Title.  Each of the numbers (1-99) creates a
  1190.                 unique bulletin board for that script.  If you want people
  1191.                 to be able to read and post to the same bulletin board from
  1192.                 two different locations, you just make sure they have the
  1193.                 same number
  1194.  
  1195.   SCRIPTS.DOC                                                        Page 24
  1196.   ─═════════════════════════════════════════════════════════════════════════─
  1197.   Command Descriptions :
  1198.  
  1199.     MonsterAvailable
  1200.   ────────────────────────────────────────────────────────
  1201.   Syntax :      MonsterAvailable <Variable>
  1202.  
  1203.   Description : This command sets the variable to a 1 if there is a
  1204.                 monster available in the CreatureFile of the same level
  1205.                 as the character, and a 0 if there is not.
  1206.  
  1207.   Notes :       If no creature file has been set, this command will
  1208.                 always set the variable to 0 (since the won't be ANY
  1209.                 monsters in the file).  This is a good way of determining
  1210.                 if the character is in the proper area for a character of
  1211.                 his/her level.
  1212.  
  1213.   Example :     
  1214.                 MonsterAvailable ^GF28
  1215.                 If ^GF28 == 1
  1216.                   Combat ^GF29 Ext
  1217.                   Return
  1218.                 Endif
  1219.                 Writeln "`9  There is nothing here for you to fight."
  1220.  
  1221.  
  1222.     Mult
  1223.   ────────────────────────────────────────────────────────
  1224.   Syntax :      Mult <Variable> <number>
  1225.  
  1226.   Description : This command is used to multiply a variable by a certain
  1227.                 number, and store the results back in the variable.
  1228.  
  1229.   Notes :       The number portion of the command can also be a variable
  1230.                 of any type.  Note that this command will overwrite the
  1231.                 number existing in the variable.  If a string is set in
  1232.                 either of the variables, the result will be 0.
  1233.  
  1234.   Example :     
  1235.                 Set ^VR02 5
  1236.                 Mult ^VR02 ^CS22
  1237.                 Writeln "Your level *5 = ^VR02"
  1238.  
  1239.     Pause
  1240.   ────────────────────────────────────────────────────────
  1241.   Syntax :      Pause
  1242.  
  1243.   Description : This command is used to print the Hit Any Key message to
  1244.                 the user and suspend execution until a key is pressed.
  1245.  
  1246.   Notes :       This is a call to the same command the main part
  1247.                 of the game calls.  I would use it so a user can
  1248.                 read anything you put on the screen before you clear
  1249.                 it.
  1250.   SCRIPTS.DOC                                                        Page 25
  1251.   ─═════════════════════════════════════════════════════════════════════════─
  1252.   Command Descriptions :
  1253.  
  1254.     Random
  1255.   ────────────────────────────────────────────────────────
  1256.   Syntax :      Random <Variable> <number>
  1257.  
  1258.   Description : This commad is used to generate a random number from
  1259.                 1 - <number> and store is in <Variable>.
  1260.  
  1261.   Notes :       The number portion of the command can also be a variable
  1262.                 of any type.  Note that this command will overwrite the
  1263.                 number existing in the variable.  If a string is set in
  1264.                 the <number> section, the result will be 0.
  1265.  
  1266.   Example :     Random ^VR04 ^CS22
  1267.                 (Picks a random number from 1-character level and stores
  1268.                 it in ^VR04)
  1269.  
  1270.  
  1271.     ReadChar
  1272.   ────────────────────────────────────────────────────────
  1273.   Syntax :      ReadChar <Variable>
  1274.  
  1275.   Description : This command stops and waits for the user to press a
  1276.                 key, and then stores that character in <Variable>
  1277.  
  1278.   Notes :       The input is disconnected from what type of character
  1279.                 the user hits.  If they put in a number, the operations
  1280.                 dealing with numbers will work on it and if they put in
  1281.                 a string, the operations dealing with numbers will not
  1282.                 work on it.
  1283.  
  1284.   Example :     ReadChar ^VR02
  1285.                 If ^VR02 == C
  1286.                   Writeln "You pressed C"
  1287.                 Endif
  1288.  
  1289.     ReadLine
  1290.   ────────────────────────────────────────────────────────
  1291.   Syntax :      ReadLine <Variable>
  1292.  
  1293.   Description : This command stops and waits for the user to enter
  1294.                 a line of text and press enter, and then stores that
  1295.                 line of text in <Variable>
  1296.  
  1297.   Notes :       The input is disconnected from what type of line the
  1298.                 user enters.  See the notes on ReadChar for exact details.
  1299.  
  1300.   Example :     DefaultCommand ^CS18
  1301.                 Write "How Many Gold Pieces to Donate? [^VR21] : "
  1302.                 ReadLine ^VR03
  1303.                 If ^VR03 > 0
  1304.                   If ^VR03 < ^CS18
  1305.                     Add ^VR19 ^VR03
  1306.                     Add ^CS18 -^VR03
  1307.                   Endif
  1308.                 Endif
  1309.   SCRIPTS.DOC                                                        Page 26
  1310.   ─═════════════════════════════════════════════════════════════════════════─
  1311.   Command Descriptions :
  1312.  
  1313.     ReadMenuCommands
  1314.   ────────────────────────────────────────────────────────
  1315.   Syntax :      ReadMenuCommands <Variable>
  1316.  
  1317.   Description : This command first displays the commands that were
  1318.                 read in from the menu command, then displays the
  1319.                 Command : prompt along with the DefaultCommand then
  1320.                 stops and waits for the user to press a key and
  1321.                 stores that character in <Variable>
  1322.  
  1323.   Notes :       This should go shortly after the Menu Command in the
  1324.                 section of the script.  Other than what it prints out,
  1325.                 the ReadChar command does the same function.
  1326.                 This command does NOT print out the character it reads.
  1327.  
  1328.   Example :     
  1329.                 Menu MAIN_MENU
  1330.                 DefaultCommand L
  1331.                 ReadMenuCommands ^VR01
  1332.                 Writeln "^VR01"
  1333.                 If .....
  1334.                 ....
  1335.                 Endif
  1336.  
  1337.     ReDispMenu
  1338.   ────────────────────────────────────────────────────────
  1339.   Syntax :      ReDispMenu <TRUE/FALSE>
  1340.  
  1341.   Description : This command affects whether a menu is shown to a
  1342.                 character or not the next time the MENU command is
  1343.                 executed.
  1344.  
  1345.   Notes :       By default, every time the Menu command is executed,
  1346.                 the menu specified is displayed to the user.  The
  1347.                 exception to this rule is when a section "bounces", 
  1348.                 meaning when it gets to the end of the section and
  1349.                 goes back up to the top, the menu command is ignored.
  1350.                 When a Gosub/Return sequence is executed, the menu 
  1351.                 will be re-read AND re-displayed after the "bounce".
  1352.                 To prevent this from redisplaying, you would use
  1353.                 a ReDisplMenu FALSE before the return.
  1354.  
  1355.   Example :     
  1356.                 @#FIGHT
  1357.                   Writeln ""
  1358.                   Writeln "You find nothing to fight"
  1359.                   ReDispMenu FALSE
  1360.                   Return
  1361.                 @#MAIN
  1362.                 Menu MAIN_MENU
  1363.                 ReadMenuCommands ^VR01
  1364.                 If ^VR01 == S
  1365.                   Gosub Fight
  1366.                 Endif
  1367.   SCRIPTS.DOC                                                        Page 27
  1368.   ─═════════════════════════════════════════════════════════════════════════─
  1369.   Command Descriptions :
  1370.  
  1371.     Return
  1372.   ────────────────────────────────────────────────────────
  1373.   Syntax :      Return
  1374.  
  1375.   Description : This command is the partner of Gosub.  It will take
  1376.                 the scripts execution back to the next command in
  1377.                 the calling section and continue execution from that
  1378.                 point.
  1379.  
  1380.   Notes :       Remember to include this command.  Without it, the called
  1381.                 section will repeat forever.  Note : It is NOT necessary
  1382.                 to return back to the main loop before calling Halt.
  1383.  
  1384.     Set
  1385.   ────────────────────────────────────────────────────────
  1386.   Syntax :      Set <Variable> <number>
  1387.  
  1388.   Description : This command takes whatever is in number and stores that
  1389.                 value in <Variable>
  1390.  
  1391.   Notes :       The number portion of the command can also be a variable
  1392.                 of any type.  Note that if the variable contains multiple
  1393.                 words (A long string for example), the variable will be
  1394.                 set to only the first word in the string (Use the SetStr
  1395.                 command instead).
  1396.   Example :     
  1397.                 Set ^VR02 4
  1398.                 Set ^VR03 ^CS18
  1399.                 Set ^VR04 ^VR20
  1400.                 Set ^GF 1
  1401.                 Set ^CS18 0
  1402.  
  1403.  
  1404.     SetStr
  1405.   ────────────────────────────────────────────────────────
  1406.   Syntax :      SetStr <Variable> "<Text>"
  1407.  
  1408.   Description : This command takes whatever <Text> is (containing multiple
  1409.                 words if necessary) and stores it in <Variable>
  1410.  
  1411.   Notes :       The <Text> portion of the command can contain any
  1412.                 combination of literals and variables, as the variables
  1413.                 will be expanded to their stored value.
  1414.                 Note : The maximum length of a variable is 80 characters.
  1415.                 The string is stored exactly as you type it, and any
  1416.                 variables are calculated when the line is printed out or
  1417.                 something is done with it, so the same line can be used
  1418.                 without having to Re-Set it every time.
  1419.  
  1420.   Example :     
  1421.                 SetStr ^VR02 "You have ^CS10 Hit Points Left"
  1422.                 SetStr ^VR03 "^CS01 is a stud!"
  1423.   SCRIPTS.DOC                                                        Page 28
  1424.   ─═════════════════════════════════════════════════════════════════════════─
  1425.   Command Descriptions :
  1426.  
  1427.     SharedEvent
  1428.   ────────────────────────────────────────────────────────
  1429.   Syntax :      SharedEvent <Event Number> | 0
  1430.  
  1431.   Description : This command causes a special event written into the
  1432.                 compiled code of the game to occur.
  1433.  
  1434.   Notes :       This will become useful as the game expands and more
  1435.                 events become available.  This is here now so that the
  1436.                 old man in the wagon can be available in any scenario.
  1437.                 Passing 0 as the event number will have it choose one
  1438.                 at random.
  1439.  
  1440.   Events :      1       Old Man in Wagon
  1441.  
  1442.   Example :
  1443.                 If ^VR01 == S
  1444.                   If ^CS26 > 0
  1445.                     SharedEvent 1                
  1446.                   EndIf
  1447.                 EndIf
  1448.  
  1449.  
  1450.     Write
  1451.   ────────────────────────────────────────────────────────
  1452.   Syntax :      Write "<Text to Display>"
  1453.  
  1454.   Description : This command will display the text between the quotation
  1455.                 marks to the user's screen, without a newline or a
  1456.                 carriage return.
  1457.  
  1458.   Notes :       Useful in conjunction with the ReadChar function for
  1459.                 one-key input.
  1460.  
  1461.   Example :
  1462.                 @#Ask
  1463.                   DefaultCommand Y
  1464.                   Write "  `9Leave Game, are you sure? (Y/N) [^VR21] : "
  1465.                   Readchar ^VR01
  1466.                   If ^VR01 == Y
  1467.                     Halt
  1468.                   Endif
  1469.                   ReDispMenu FALSE
  1470.                   Return
  1471.   SCRIPTS.DOC                                                        Page 29
  1472.   ─═════════════════════════════════════════════════════════════════════════─
  1473.   Command Descriptions :
  1474.  
  1475.     Writeln
  1476.   ────────────────────────────────────────────────────────
  1477.   Syntax :      Writeln "<Text to Display>"
  1478.  
  1479.   Description : This command will display the text between the quotation
  1480.                 marks to the user's screen, followed by a newline and a
  1481.                 carriage return.
  1482.  
  1483.   Notes :       Useful when displaying a line or two of text to the player
  1484.                 where there are few things on each line.
  1485.  
  1486.   Example :
  1487.                 If ^VR02 == CRACK
  1488.                   Writeln "`!  You bend down and examine the cracks in"
  1489.                   Writeln "  the crypt.  There seems to be nothing there"
  1490.                   ReDispMenu FALSE
  1491.                   Return
  1492.                 Endif
  1493.  
  1494.  
  1495.     WriteBlock/EndBlock
  1496.   ────────────────────────────────────────────────────────
  1497.   Syntax :      WriteBlock
  1498.                 <.. Text to Display ..>
  1499.                 <.. More Text ..>
  1500.                 EndBlock
  1501.  
  1502.   Description : This command will display the text between the Starting
  1503.                 WriteBlock and the EndBlock command.
  1504.  
  1505.   Notes :       Useful when displaying many lines of text to the player.
  1506.                 Text is sent _exactly_ as you type it, including any leading
  1507.                 spaces in the code.
  1508.  
  1509.   Example :
  1510.                 WriteBlock
  1511. `c  `9You have entered the crypt of the deceased former Lord of Shamile `%:
  1512. `4  Lord Hamilton`9.  Lord Hamilton was the most influential and extravagant
  1513. `9  ruler Shamile has ever seen.  It is rumored that he made a pact with the
  1514. `9  devil himself to win himself popularity, riches and influence.  Noone is
  1515. `9  still alive who can tell all of the machinations of his time, but several
  1516. `9  journals have been unaccounted for.  The town sages claim that these tombs
  1517. `9  have within their walls hidden compartments which hide the very items that
  1518. `9  may reveal a little more about Lord Hamilton''s past and whether his pact
  1519. `9  with the devil is what has brought about this plague on the realm.
  1520.                 EndBlock
  1521.   SCRIPTS.DOC                                                        Page 30
  1522.   ─═════════════════════════════════════════════════════════════════════════─
  1523.   Command Descriptions :
  1524.  
  1525.     AddFlag
  1526.   ────────────────────────────────────────────────────────
  1527.   Syntax :      AddFlag <Name_of_Flag> <Value_of_Flag> <reset_value> <type>
  1528.  
  1529.   Description : This command will set a semi-permanent flag on the character,
  1530.                 script, or game that is written to a file for saving.
  1531.  
  1532.   Notes :       There are so many uses for this, its only limit is your
  1533.                 creativity.  It can be used to tie two ExMODs together by
  1534.                 having a character bring an object (saved as a flag) from one
  1535.                 script to a NPC in another!  It can also be used to make
  1536.                 your ExMOD visitable only once by a character per day (with
  1537.                 the use of the reset_value set to daily and having the script
  1538.                 set a flag to the character when they come in the first time
  1539.                 and have it halt if the flag has already been set the next
  1540.                 time they come in!)
  1541.  
  1542.                 Name_of_Flag and Value_of_Flag must be a single word
  1543.                 (i.e. NO SPACES!) use the underscore (_) to seperate words
  1544.                 in it if you use them.
  1545.  
  1546.                 The <type> of flag specifies how it is accessed.
  1547.                 Type can have the following values:
  1548.  
  1549.                 Value:          Where Located:
  1550.                 ------------------------------------
  1551.                   M               On the main portion of the game
  1552.                   S               On only your script file
  1553.                   C               On the character
  1554.  
  1555.                 Where the flag is located restricts what can or cannot access
  1556.                 that flag.  If you were to place it on the main portion of the
  1557.                 game, any script/EXMOD could access it, and it should be
  1558.                 available for all characters (i.e. nothing character specific)
  1559.                 If you were to place it on only your script file, only your
  1560.                 script could access it, and, again, it should be available for
  1561.                 all characters.  If you place it on the character, then, that
  1562.                 flag becomes available for all scripts/EXMOD's to use, but it
  1563.                 is only available when it is that character performing the
  1564.                 actions.
  1565.  
  1566.                 Reset value determines when the flag gets removed.
  1567.                 It can have the following values:
  1568.  
  1569.                 Value:          When Removed:
  1570.                 ------------------------------------
  1571.                   0               When the character dies*
  1572.                   1               Daily
  1573.                   2               Only by a RemoveFlag command
  1574.                 *Only usable if the type is set to C - character.
  1575.  
  1576.                 Using a reset_value of 0 is a good idea for flags to
  1577.                 represent things like items carried, information learned, or
  1578.                 anything that would seem reasonable.
  1579.   SCRIPTS.DOC                                                        Page 31
  1580.   ─═════════════════════════════════════════════════════════════════════════─
  1581.   Command Descriptions :
  1582.  
  1583.     AddFlag (cont.)
  1584.  
  1585.                 A use of the daily reset type is some action should only occur
  1586.                 once per day, if it is something that a character can solve,
  1587.                 or a daily winner of the lottery, then use this reset type.
  1588.  
  1589.                 The reset_value of 2 is a special one as it will only go away
  1590.                 if a script calls a RemoveFlag on that exact variable (or in
  1591.                 the case of placing it on a character, it will go away when the
  1592.                 character gets deleted by daily maintenance), so its uses
  1593.                 should be restricted to things that should be maintained over
  1594.                 a period of time.  Curses (for characters), the name of the
  1595.                 kings favored adventurer or the name of the character who has
  1596.                 solved your adventure the most.  These are the variables
  1597.                 that are significant people and values and for characters,
  1598.                 things that are _SO_ significant that even death itself should
  1599.                 not remove this flag.
  1600.  
  1601.                 Flag naming convention:
  1602.                 Use a unique word that is associated with your script as the
  1603.                 first word, then use an underscore and then the name of the
  1604.                 flag i.e.
  1605.                 CRYPT_FOUND_KEY
  1606.                 CRYPT_OPENED_WALL
  1607.  
  1608.     RemoveFlag
  1609.   ────────────────────────────────────────────────────────
  1610.   Syntax :      RemoveFlag <Name_of_Flag> <type>
  1611.  
  1612.   Description : This command will remove a flag that has been set on the
  1613.                 character.
  1614.  
  1615.   Notes :       This is the only way to remove a flag that was set with the
  1616.                 reset value set to 2.  It can also be used when a quest is
  1617.                 complete to remove all flags that were used in the quest.
  1618.  
  1619.                 The <type> of flag specifies where to remove the flag from.
  1620.                 Type can have the following values:
  1621.  
  1622.                 Value:          Where to Remove From:
  1623.                 ------------------------------------
  1624.                   M               From the main portion of the game
  1625.                   S               From your script file
  1626.                   C               From the character's flag file
  1627.  
  1628.   SCRIPTS.DOC                                                        Page 32
  1629.   ─═════════════════════════════════════════════════════════════════════════─
  1630.   Command Descriptions :
  1631.  
  1632.     FlagValue
  1633.   ────────────────────────────────────────────────────────
  1634.   Syntax :      FlagValue <Variable> <Name_of_Flag> <type>
  1635.  
  1636.   Description : This command will return the value of a flag from the
  1637.                 characters file and assign it into the variable specified
  1638.                 in <Varialbe>
  1639.  
  1640.   Notes :       This is how you can do tests to see if a character or
  1641.                 a script or the main portion of the game has a
  1642.                 particular flag set, and if so, what the value is.
  1643.                 If the desired type has the flag, the value is placed into the
  1644.                 ^VR type variable specified.  If it does not exist, a value
  1645.                 of -1 is placed into the variable.
  1646.  
  1647.                 The <type> of flag specifies where to look to get the value.
  1648.                 Type can have the following values:
  1649.  
  1650.                 Value:          Where to Retrive From:
  1651.                 ------------------------------------
  1652.                   M               From the main portion of the game
  1653.                   S               From your script file
  1654.                   C               From the character's flag file
  1655.  
  1656.